function d=rand_int(a,b)
% rand_int: Generate a random integer in specified interval
%
% SYNTAX:
%   d = rand_int(a,b)
%   Return generated random integer in interval [a,b]

%   Author: Hongbin Ma
%   Last updated: 2009-6-2 with MATLAB 6.5
%   Problems or suggestions? Email me: mathmhb[at]163.com

d=floor((b+1-a)*rand(1)+a);
